<?php 
class Planing extends Controller {

	function Planing()
	{
		parent::Controller();
		$this->load->library('layout','layouts/layout_default');	
		$this->load->library('session');
		$this->load->model('accion');
		$this->load->model('categoria');
	}
	
	function index()
	{
	$data['title']="Superusuario";
	$data['heading']="My  Heading";
	$this->layout->view('planing/search',$data);
	}
	function scheme()
	{
		$data['title'] = "project";
		$data['heading'] = "My  Heading";
		$data['valor'] = "";
		$data['script'] = "";
		$data['show'] = false;
		
		if ($_SERVER['REQUEST_METHOD']=='POST'){
			if(isset($_POST["buscar_responsable"])){
				echo "Buscar responsable";
				}
			if(isset($_POST["info"])){
				echo "Informacion";
				}
			if(isset($_POST["guardar"])){
				echo "Agregar";
				$values = array("nombre"=> ( isset ($_REQUEST['nombre']) ? $_REQUEST['nombre'] : "" ),
							"prioridad"=> ( isset ($_REQUEST['prioridad']) ? $_REQUEST['prioridad'] : "" ),
							"inicio_programado"=> ( isset ($_REQUEST['inicio']) ? $_REQUEST['inicio'] : "" ),
							"fin_programado"=> ( isset ($_REQUEST['fin']) ? $_REQUEST['fin'] : "" ),
							"nivel"=> ( isset ($_REQUEST['niveles']) ? $_REQUEST['niveles'] : "" ),
							"id_proyecto"=> ( isset ($_REQUEST['proyecto']) ? $_REQUEST['proyecto'] : "" ) );
				$responsable =  ( isset ($_REQUEST['responsable']) ? $_REQUEST['responsable'] : "" );			
				$values['nivel']=substr($values['nivel'],6,1);
				$this->accion->insert($values);			
				}

			if(isset($_POST["elminar"])){
				echo "<pre>";
				print_r($_POST);
				}
				
    if(isset($_POST["mostrar"]))
		{
		$element = 	( isset ($_REQUEST['valor']) ? $_REQUEST['valor'] : "" );
		if($element!=""){
			$data['show'] = true;
			$data['rows'] = $this->accion->getOne($element);
			}
 	 	}
    if(isset($_POST["sacar"]))
		{
		$this->accion->recursivo2('51');
		}
  /*fin opciones form*/
		}
		$this->layout->view('planing/scheme',$data);
	}
	function employed()
	{
		$data['title']="employed";
		$data['heading']="My  Heading";
		$this->layout->view('admin/admins/index',$data);
	}
	
	function search()
	{
	$data['title']="Superusuario";
	$data['heading']="My  Heading";
	$this->layout->view('planing/search',$data);
	}
}
?>